/**
 * Created by Administrator on 2019/5/27.
 */
new Vue({
    el:"#Community",
    data:{
        url:"https://www.x5tx.cn",
        count:0,
        active:1,
        actives:0,
        bid:null,
        cid:null,
        did:'',
        name:'',
        flag:"home-component",
        total: 1,     // 记录总条数
        display: 15,   // 每页显示条数
        current: 1,   // 当前的页数
        show:[
            {
                stu:0,
                name:"下架"
            },
            {
                stu:1,
                name:"上架"
            }
        ],
        list:[],
        detail:{},
        _this:this,
        audios:"libs/dingdong.mp3"
    },
    mounted(){
        var _th = this;


    },
    filters:{
        statusfilter:function(value){
            var name = '';
            value[1].forEach(function (item,index) {
                if(value[0] == item.stu){
                    name = item.name;
                }
            })
            return name
        },
        classifylist:function (value) {
            var name = '';
            value[1].forEach(function (item,index) {
                if(value[0] == item.id){
                    name = item.name;
                }
            })
            return name
        }
    },
    methods:{
        loginOut:function () {
            //退出登录
            layer.confirm("确定退出登录？",{ btn:["确定","取消"]},function () {
                delCookie("token");
                window.location.href = "login.html"
            },function (index) {
                layer.close(index);
            })
        },
        changeTabs:function (type) {
            //选择一级菜单
            this.active = type;
            if($(event.target).attr("class") == 'active'){
                this.active = 0;
                this.actives = 0;
            }else{

            }
            if(type === 1){
                this.flag = "home-component";
                this.actives = 0;
            }

        },
        changeTab:function (type,id) {
            //选择二级菜单
            this.actives = type
            this.did = ''
            if($(event.target).attr("class") != 'second-menu'){
                // this.actives = 0;
            }
            if(type == 1){
                this.flag = "legwork-component";
                this.cid = null;
                this.did = id;
            }
            if(type === 2){
                this.flag = "fllist-component";
                this.cid = null;
            }
            if(type === 3){
                this.flag = "service-component";
                this.cid = null;
            }
            if(type === 4){
                this.flag = "zllist-component";
                this.cid = null;
            }
            if(type === 5){
                this.flag = "rent-component";
                this.cid = null;
            }
            if(type === 6){
                this.flag = "bklist-component";
                this.cid = null;
            }
            if(type === 7){
                this.flag = "encyclopedias-component";
                this.cid = null;

            }
            if(type === 8){
                this.flag = "bkxq-component";
                this.cid = id;
                this.bid = id;
                this.actives = 7;
            }

            if(type === 9){
                this.flag = "dhlist-component";
                this.cid = null;

            }
            if(type == 10){
                this.flag = "common-component";
                this.cid = null;
                this.bid = id;
            }
            if(type === 11){
                this.flag = "ltlist-component";
                this.cid = null;
                this.bid = id;
            }
            if(type === 12){
                this.flag = "post-component";
                this.cid = null;
                this.bid = id;
            }
            if(type === 13){
                this.flag = "report-component";
                this.cid = null;
                this.bid = id;
                this.actives = 12;
            }
            if(type === 14){
                this.flag = "notice-component";
                this.cid = null;
            }
            if(type === 15){
                this.flag = "activity-component";
                this.cid = null;
            }
            if(type === 16){
                this.flag = "activityinfo-component";
                this.cid = id;
                this.actives = 15;
            }
            if(type === 20){
                this.flag = "banner-component";
                this.cid = null;
            }
            if(type === 18){
                this.flag = "shop-component";
                this.cid = null;
            }
            if(type === 19){
                this.flag = "attribute-component";
                this.cid = null;
            }
            if(type === 21){
                this.flag = "goods-component";
                this.cid = null;
            }

            if(type === 22){
                this.flag = "order-component";
                this.cid = null;
                this.did = id;
            }
            if(type === 23){
                this.flag = "paotui-component";
                this.cid = null;
            }
            if(type === 24){
                this.flag = "coupon-component";
                this.cid = null;
            }
            if(type === 25){
                this.flag = "manoeuvre-component";
                this.cid = null;
            }
            if(type === 26){
                this.flag = "member-component";
                this.cid = null;
            }
            if(type === 27){
                this.flag = "rentorder-component";
                this.cid = null;
                this.did = id;
            }
            if(type === 28){
                this.flag = "satistics-component";
                this.cid = null;
            }
            if(type === 29){
                this.flag = "count-component";
                this.cid = null;
            }
            if(type === 30){
                this.flag = "shopedit-component";
                this.cid = null;
            }

        },
        edits:function (id,str,name) {
            this.cid = id;

            if(str === "fenlei"){
                this.flag='fldetail-component';
            }else if(str === "service"){
                this.flag='servicedetail-component';
            }
            else if(str === "zulin"){
                this.flag='zldetail-component';
            }
            else if(str === "rent"){
                this.flag='rentdetail-component';
            }
            else if(str === "baike"){
                this.flag='bkdetail-component';
            }
            else if(str === "encyclopedias"){
                this.flag='encyclopediasdetail-component';
            }
            else if(str === "problem"){
                this.flag='problemdetail-component';
            }
            else if(str === "dianhua"){
                this.flag='dhdetail-component';
            }
            else if(str === "common"){
                this.flag='commondetail-component';
            }
            else if(str === "luntan"){
                this.flag='ltdetail-component';
            }
            else if(str === "post"){
                this.flag='postdetail-component';
            }
            else if(str === "activity"){
                this.flag='activitydetail-component';
            }
            else if(str === "banner"){
                this.flag='bannerdetail-component';
            }
            else if(str === "shop"){
                this.flag='shopdetail-component';
            }
            else if(str === "attribute"){
                this.flag='attributedetail-component';
                this.name = name;
            }
            else if(str === "goods"){
                this.flag='goodsdetail-component';
            }
            else if(str === "order"){
                this.flag='orderdetail-component';
            }
            else if(str === "p_order"){
                this.flag='p_orderdetail-component';
            }
            else if(str === "coupon"){
                this.flag='coupondetail-component';
            }
            else if(str === "manoeuvre"){
                this.flag='manoeuvredetail-component';
            }
            else if(str === "member"){
                this.flag='memberinfo-component';
            }
            else if(str === "goodsactivity"){
                this.flag='goodsactivity-component';
            }
        },
    }
})


